#pragma once
class Serializable
{
public:

    enum Type
    {
        null_type,
        player
    };

    Serializable();
    Serializable(int owner_id, int external_id);

    /* serialize the object to raw char data */
    virtual void serialize(std::vector<unsigned char>& buffer) = 0;
    /* update the object from raw char data */
    virtual void deSerialize(std::vector<unsigned char>& buffer) = 0;

    bool hasId(int _id) { return id == _id; }
    bool isType(Type _type) { return type == _type; }   

protected:
    Type type;
    /* per gameclient unique ID */
    int id;
    /* whether this obj has been serialized and passed to other gameclients */
    bool sent;
    /* 0: locally owned, 1..n: owned by other gameclient */
    int owner_id;
};

